﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.Practices.Mobile.ContainerModel;

namespace EditUsers_Best
{
    /// <summary>
    /// Service exposed by the shell that allows modules to publish tasks 
    /// they provide.
    /// The service exposes IEnumerable so that users can 'foreach' through the
    /// collection.
    /// </summary>
    public interface ITaskService
    {
        /// <summary>
        /// Here we register an IView type, giving it a name and an icon.
        /// </summary>
        void Register<TView>(string taskName, System.Drawing.Icon icon)
            where TView : IView;

        /// <summary>
        /// Executes the task with the given name.
        /// </summary>
        void Execute(string taskName);

        /// <summary>
        /// Lists the registered Tasks
        /// </summary>
        Dictionary<string, TaskDetail> Tasks { get; }

    }

    public class TaskDetail
    {
        public Icon Icon { get; set; }
        public Action<Container> Action { get; set; }
    }
}
